<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="referrer" content="no-referrer"/>
    <link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/loading-icon.css">
    <title>我的资产</title>
</head>
<body>
<div class="sk-three-bounce" id="sk-three-bounce" style="display: none">
    <div class="sk-child sk-bounce1"></div>
    <div class="sk-child sk-bounce2"></div>
    <div class="sk-child sk-bounce3"></div>
</div>


<div id="flow_block" class="layui-form" style="display: none">
    <form method="post" class="layui-form layui-form-pane" style="margin: 10px" action="/sellProduct">
        <div class="layui-form-item">
            <label class="layui-form-label">产品编号</label>
            <div class="layui-input-inline">
                <input type="number" class="layui-input" lay-verify="required|number" name="product_id" id="product_id">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户ID</label>
            <div class="layui-input-inline">
                <input type="number" class="layui-input" lay-verify="required|number" name="client_id" id="client_id">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">卖出金额</label>
            <div class="layui-input-inline">
                <input type="number" class="layui-input" lay-verify="required|number" name="sell_amount">
            </div>
        </div>
        <div class="layui-form-item" style="text-align: center">
            <input type="submit" value="确定卖出" class="layui-btn layui-btn-normal">
        </div>
    </form>
</div>



    <div>
        <table lay-filter="demo1">
            <thead>
            <tr>
                <th lay-data="{field:'product_id',sort:true}">产品编号</th>
                <th lay-data="{field:'amount',sort:true}">持有金额</th>
                <th lay-data="{width:200, toolbar:'#barDemo1'}">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="record:${results1}">
                <td th:text="${record.product_id}">产品编号</td>
                <td th:text="${record.amount}">产品描述</td>
            </tr>
            </tbody>
        </table>
    </div>




    <div>
        <table lay-filter="demo2">
            <thead>
            <tr>
                <th lay-data="{field:'client_id',sort:true}">用户ID</th>
                <th lay-data="{field:'client_name',sort:true}">用户名</th>
                <th lay-data="{field:'balance_sum',sort:true}">银行卡余额</th>
                <th lay-data="{field:'due_sum',sort:true}">欠款额</th>
                <th lay-data="{field:'product_sum',sort:true}">购买产品总价值</th>
                <th lay-data="{field:'total',sort:true}">总资产</th>
                <th lay-data="{field:'frozen',sort:true}">冻结资产</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="record:${results2}">
                <td th:text="${record.client_id}">用户ID</td>
                <td th:text="${record.client_name}">用户名</td>
                <td th:text="${record.balance_sum}">银行卡余额</td>
                <td th:text="${record.due_sum}">欠款额</td>
                <td th:text="${record.product_sum}">购买产品总价值</td>
                <td th:text="${record.balance_sum + record.product_sum}">总资产</td>
                <td th:text="${record.due_sum < record.balance_sum ? record.due_sum:record.balance_sum}">冻结资产</td>
            </tr>
            </tbody>
        </table>
    </div>


<div id="chart1" style="width: 100%;height:400px;"></div>




<script type="text/javascript" src="/static/js/jquery-3.4.1.js"></script>
<script type="text/javascript" src="/static/js/echarts.js"></script>
<script type="text/javascript" src="/static/layui/layui.js"></script>
<script type="text/javascript" src="/static/js/LoadingJS.js"></script>
<script type="text/html" id="barDemo1">
    <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="edit">卖出</a>
</script>
<script>
    var table = layui.table;

    //转换静态表格
    table.init('demo1', {
        limit: 8 //注意：请务必确保 limit 参数（默认：10）是与你服务端限定的数据条数一致
        //支持所有基础参数
        ,page:true
        ,limits: [8,16,24,32,40,48,56,64,72]
    });

    table.init('demo2', {
        limit: 8 //注意：请务必确保 limit 参数（默认：10）是与你服务端限定的数据条数一致
        //支持所有基础参数
        ,page:true
        ,limits: [8,16,24,32,40,48,56,64,72]
    });
</script>
<script type="text/javascript" src="/static/js/MyAssetViewer.js"></script>
</body>
</html>